package cn.lanqiao.demo.controller;

import cn.lanqiao.demo.service.CheckService;
import cn.lanqiao.demo.service.VaccineService;
import cn.lanqiao.demo.vo.StudentVaccineVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/vaccine")
public class VaccineController {
    private VaccineService vaccineService;

    @Autowired
    public void setVaccineService(VaccineService vaccineService) {
        this.vaccineService = vaccineService;
    }



    //接受前端传来的参数，显示接种一剂，接种两剂，未接种学生信息
    @GetMapping("/inoculated")
    public List<StudentVaccineVo> getInoculated(int inoculated) {
        return vaccineService.getInoculated(inoculated);
    }

    @GetMapping("/countNo")
    public int getCount(int inoculated){
        return vaccineService.getCount(inoculated);
    }
}
